package com.yix.admin.modules.system.entity;

import com.yix.common.base.BaseIdentityIdEntity;
import com.yix.common.base.BaseUUIDEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;

/**
 * @author wdx
 * @version 1.0
 * @Description TODO
 * @date 2021/2/5 13:44
 */
@Entity
@Getter
@Setter
@Table(name="sys_dict")
public class SysDict extends BaseIdentityIdEntity implements Serializable {

    @OneToMany(mappedBy = "dict",cascade={CascadeType.PERSIST,CascadeType.REMOVE})
    private List<SysDictDetail> dictDetails;

    @NotBlank
    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "描述")
    private String description;
}
